import { reactive } from "vue";
import type { FormRules } from "element-plus";
import { isPhone, isEmail } from "@pureadmin/utils";

/** 自定义表单规则校验 */
export const formRules = reactive(<FormRules>{
  ParentId: [{ required: true, message: "上级菜单为必选项", trigger: "blur" }],
  Name: [{ required: true, message: "菜单名称为必填项", trigger: "blur" }],
  pageurl: [{ required: true, message: "菜单地址为必填项", trigger: "blur" }],
  Code: [{ required: true, message: "菜单编号为必填项", trigger: "blur" }],
  apiurl: [{ required: true, message: "前端地址为必填项", trigger: "blur" }],
  Sort: [{ required: true, message: "显示排序为必填项", trigger: "blur" }],
  Status: [{ required: true, message: "状态为必填项", trigger: "change" }],
  Type: [{ required: true, message: "类型为必填项", trigger: "change" }]
});
